<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

    <script>

        // Object.assign(obj1 , obj2 ...)  拼接对象，返回新的对象   ----  浅复制


        // Object.keys(obj)得到对象的键名，返回数组

        const obj = { a: 1 };
        const obj3 = { b: 1 };

        const obj2 = Object.assign(obj, obj3);

        console.log(obj2)


        obj.c = 3;

        console.log(obj2)


        // 得到对象的键名，返回数组
        const res = Object.keys(obj2);
        console.log(res)

        obj2.d = 5;





    </script>

</body>

</html>